\section{Tools.WebClient类参考}
\label{class_tools_1_1_web_client}\index{Tools::WebClient@{Tools::WebClient}}
\subsection*{公有成员}
\begin{DoxyCompactItemize}
\item 
{\bf WebClient} ()
\begin{DoxyCompactList}\small\item\em 创建WebClient的实例 \item\end{DoxyCompactList}\item 
string {\bf GetHtml} (string url)
\begin{DoxyCompactList}\small\item\em 获取网页源代码 \item\end{DoxyCompactList}\item 
void {\bf DownloadFile} (string url, string filename)
\begin{DoxyCompactList}\small\item\em 下载文件 \item\end{DoxyCompactList}\item 
byte[$\,$] {\bf GetData} (string url)
\begin{DoxyCompactList}\small\item\em 从指定URL下载数据 \item\end{DoxyCompactList}\item 
string {\bf Post} (string url, string postData)
\begin{DoxyCompactList}\small\item\em 向指定URL发送文本数据 \item\end{DoxyCompactList}\item 
string {\bf Post} (string url, byte[$\,$] postData)
\begin{DoxyCompactList}\small\item\em 向指定URL发送字节数据 \item\end{DoxyCompactList}\item 
string {\bf Post} (string url, {\bf MultipartForm} mulitpartForm)
\begin{DoxyCompactList}\small\item\em 向指定网址发送mulitpart编码的数据 \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{属性}
\begin{DoxyCompactItemize}
\item 
int {\bf BufferSize}\hspace{0.3cm}{\ttfamily  [get, set]}
\begin{DoxyCompactList}\small\item\em 设置发送和接收的数据缓冲大小 \item\end{DoxyCompactList}\item 
WebHeaderCollection {\bf ResponseHeaders}\hspace{0.3cm}{\ttfamily  [get]}
\begin{DoxyCompactList}\small\item\em 获取响应头集合 \item\end{DoxyCompactList}\item 
WebHeaderCollection {\bf RequestHeaders}\hspace{0.3cm}{\ttfamily  [get]}
\begin{DoxyCompactList}\small\item\em 获取请求头集合 \item\end{DoxyCompactList}\item 
WebProxy {\bf Proxy}\hspace{0.3cm}{\ttfamily  [get, set]}
\begin{DoxyCompactList}\small\item\em 获取或设置代理 \item\end{DoxyCompactList}\item 
Encoding {\bf Encoding}\hspace{0.3cm}{\ttfamily  [get, set]}
\begin{DoxyCompactList}\small\item\em 获取或设置请求与响应的文本编码方式 \item\end{DoxyCompactList}\item 
string {\bf RespHtml}\hspace{0.3cm}{\ttfamily  [get, set]}
\begin{DoxyCompactList}\small\item\em 获取或设置响应的html代码 \item\end{DoxyCompactList}\item 
CookieContainer {\bf CookieContainer}\hspace{0.3cm}{\ttfamily  [get, set]}
\begin{DoxyCompactList}\small\item\em 获取或设置与请求关联的Cookie容器 \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{事件}
\begin{DoxyCompactItemize}
\item 
EventHandler$<$ {\bf UploadEventArgs} $>$ {\bfseries UploadProgressChanged}\label{class_tools_1_1_web_client_a7182c910ca2553c0c16fb1d36e5aad45}

\item 
EventHandler$<$ {\bf DownloadEventArgs} $>$ {\bfseries DownloadProgressChanged}\label{class_tools_1_1_web_client_a47b16137c8c61935b0cf9e5681b8514f}

\end{DoxyCompactItemize}


\subsection{构造及析构函数文档}
\index{Tools::WebClient@{Tools::WebClient}!WebClient@{WebClient}}
\index{WebClient@{WebClient}!Tools::WebClient@{Tools::WebClient}}
\subsubsection[{WebClient}]{\setlength{\rightskip}{0pt plus 5cm}Tools.WebClient.WebClient (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}\label{class_tools_1_1_web_client_a151b2e54e76d0203d1bc1aa9cb10c52e}


创建WebClient的实例 



\subsection{成员函数文档}
\index{Tools::WebClient@{Tools::WebClient}!DownloadFile@{DownloadFile}}
\index{DownloadFile@{DownloadFile}!Tools::WebClient@{Tools::WebClient}}
\subsubsection[{DownloadFile}]{\setlength{\rightskip}{0pt plus 5cm}void Tools.WebClient.DownloadFile (
\begin{DoxyParamCaption}
\item[{string}]{ url, }
\item[{string}]{ filename}
\end{DoxyParamCaption}
)}\label{class_tools_1_1_web_client_a83dcad972d5529e974836ed196433a19}


下载文件 


\begin{DoxyParams}{参数}
{\em url} & 文件URL地址\\
\hline
{\em filename} & 文件保存完整路径\\
\hline
\end{DoxyParams}
\index{Tools::WebClient@{Tools::WebClient}!GetData@{GetData}}
\index{GetData@{GetData}!Tools::WebClient@{Tools::WebClient}}
\subsubsection[{GetData}]{\setlength{\rightskip}{0pt plus 5cm}byte [$\,$] Tools.WebClient.GetData (
\begin{DoxyParamCaption}
\item[{string}]{ url}
\end{DoxyParamCaption}
)}\label{class_tools_1_1_web_client_af26ce85bc23442f0d407d6446cc56144}


从指定URL下载数据 


\begin{DoxyParams}{参数}
{\em url} & 网址\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}

\end{DoxyReturn}
\index{Tools::WebClient@{Tools::WebClient}!GetHtml@{GetHtml}}
\index{GetHtml@{GetHtml}!Tools::WebClient@{Tools::WebClient}}
\subsubsection[{GetHtml}]{\setlength{\rightskip}{0pt plus 5cm}string Tools.WebClient.GetHtml (
\begin{DoxyParamCaption}
\item[{string}]{ url}
\end{DoxyParamCaption}
)}\label{class_tools_1_1_web_client_a83435eeef51692904d17439dd377f946}


获取网页源代码 


\begin{DoxyParams}{参数}
{\em url} & 网址\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}

\end{DoxyReturn}
\index{Tools::WebClient@{Tools::WebClient}!Post@{Post}}
\index{Post@{Post}!Tools::WebClient@{Tools::WebClient}}
\subsubsection[{Post}]{\setlength{\rightskip}{0pt plus 5cm}string Tools.WebClient.Post (
\begin{DoxyParamCaption}
\item[{string}]{ url, }
\item[{string}]{ postData}
\end{DoxyParamCaption}
)}\label{class_tools_1_1_web_client_a86fa7c8f6a4697e7a718c798e300332d}


向指定URL发送文本数据 


\begin{DoxyParams}{参数}
{\em url} & 网址\\
\hline
{\em postData} & urlencode编码的文本数据\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}

\end{DoxyReturn}
\index{Tools::WebClient@{Tools::WebClient}!Post@{Post}}
\index{Post@{Post}!Tools::WebClient@{Tools::WebClient}}
\subsubsection[{Post}]{\setlength{\rightskip}{0pt plus 5cm}string Tools.WebClient.Post (
\begin{DoxyParamCaption}
\item[{string}]{ url, }
\item[{{\bf MultipartForm}}]{ mulitpartForm}
\end{DoxyParamCaption}
)}\label{class_tools_1_1_web_client_aaf0c0e8d173a03e24b82880ec7e99e81}


向指定网址发送mulitpart编码的数据 


\begin{DoxyParams}{参数}
{\em url} & 网址\\
\hline
{\em mulitpartForm} & mulitpart form data\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}

\end{DoxyReturn}
\index{Tools::WebClient@{Tools::WebClient}!Post@{Post}}
\index{Post@{Post}!Tools::WebClient@{Tools::WebClient}}
\subsubsection[{Post}]{\setlength{\rightskip}{0pt plus 5cm}string Tools.WebClient.Post (
\begin{DoxyParamCaption}
\item[{string}]{ url, }
\item[{byte[$\,$]}]{ postData}
\end{DoxyParamCaption}
)}\label{class_tools_1_1_web_client_a9289cb4f38cf194e200615c5c4107ab6}


向指定URL发送字节数据 


\begin{DoxyParams}{参数}
{\em url} & 网址\\
\hline
{\em postData} & 发送的字节数组\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}

\end{DoxyReturn}


\subsection{属性文档}
\index{Tools::WebClient@{Tools::WebClient}!BufferSize@{BufferSize}}
\index{BufferSize@{BufferSize}!Tools::WebClient@{Tools::WebClient}}
\subsubsection[{BufferSize}]{\setlength{\rightskip}{0pt plus 5cm}int Tools.WebClient.BufferSize\hspace{0.3cm}{\ttfamily  [get, set]}}\label{class_tools_1_1_web_client_a5d54525be2d4115de0283df7b8bb6a61}


设置发送和接收的数据缓冲大小 

\index{Tools::WebClient@{Tools::WebClient}!CookieContainer@{CookieContainer}}
\index{CookieContainer@{CookieContainer}!Tools::WebClient@{Tools::WebClient}}
\subsubsection[{CookieContainer}]{\setlength{\rightskip}{0pt plus 5cm}CookieContainer Tools.WebClient.CookieContainer\hspace{0.3cm}{\ttfamily  [get, set]}}\label{class_tools_1_1_web_client_a6bbe9aacce1445673e3907ee1a392ad2}


获取或设置与请求关联的Cookie容器 

\index{Tools::WebClient@{Tools::WebClient}!Encoding@{Encoding}}
\index{Encoding@{Encoding}!Tools::WebClient@{Tools::WebClient}}
\subsubsection[{Encoding}]{\setlength{\rightskip}{0pt plus 5cm}Encoding Tools.WebClient.Encoding\hspace{0.3cm}{\ttfamily  [get, set]}}\label{class_tools_1_1_web_client_a54722cec7e748abaa68845ac8d3c4171}


获取或设置请求与响应的文本编码方式 

\index{Tools::WebClient@{Tools::WebClient}!Proxy@{Proxy}}
\index{Proxy@{Proxy}!Tools::WebClient@{Tools::WebClient}}
\subsubsection[{Proxy}]{\setlength{\rightskip}{0pt plus 5cm}WebProxy Tools.WebClient.Proxy\hspace{0.3cm}{\ttfamily  [get, set]}}\label{class_tools_1_1_web_client_a23f580b077d887907780541cccb12de8}


获取或设置代理 

\index{Tools::WebClient@{Tools::WebClient}!RequestHeaders@{RequestHeaders}}
\index{RequestHeaders@{RequestHeaders}!Tools::WebClient@{Tools::WebClient}}
\subsubsection[{RequestHeaders}]{\setlength{\rightskip}{0pt plus 5cm}WebHeaderCollection Tools.WebClient.RequestHeaders\hspace{0.3cm}{\ttfamily  [get]}}\label{class_tools_1_1_web_client_acb397c7d6638f0317cd4c9aa085391a0}


获取请求头集合 

\index{Tools::WebClient@{Tools::WebClient}!RespHtml@{RespHtml}}
\index{RespHtml@{RespHtml}!Tools::WebClient@{Tools::WebClient}}
\subsubsection[{RespHtml}]{\setlength{\rightskip}{0pt plus 5cm}string Tools.WebClient.RespHtml\hspace{0.3cm}{\ttfamily  [get, set]}}\label{class_tools_1_1_web_client_aad7f3bf33cff940da19c927d7892838e}


获取或设置响应的html代码 

\index{Tools::WebClient@{Tools::WebClient}!ResponseHeaders@{ResponseHeaders}}
\index{ResponseHeaders@{ResponseHeaders}!Tools::WebClient@{Tools::WebClient}}
\subsubsection[{ResponseHeaders}]{\setlength{\rightskip}{0pt plus 5cm}WebHeaderCollection Tools.WebClient.ResponseHeaders\hspace{0.3cm}{\ttfamily  [get]}}\label{class_tools_1_1_web_client_ac22285f83b07ef26c9d6b55e4c8af9ec}


获取响应头集合 



该类的文档由以下文件生成：\begin{DoxyCompactItemize}
\item 
D:/Project/1101/Tools/UploadAndDownHelper.cs\end{DoxyCompactItemize}
